<tagLib name="html" />
{$header}<div id="main" class="main" >
<!-- 主体内容  -->
<div class="content" >
  
<!--  功能组区域  -->
<div class="btn-toolbar">
      <div class="btn-group">
          <button class="btn btn-primary" onclick="add()"><i class="icon-plus icon-white"></i> 新增</button>
          <button class="btn btn-primary" onclick="edit()"><i class="icon-edit icon-white"></i> 编辑</button>
          <!--
          <button class="btn btn-primary" onclick="copyproduct()"><i class="icon-file icon-white"></i> 复制</button>
          <button class="btn btn-primary" onclick="massedit()"><i class="icon-book icon-white"></i> 批量修改</button>
        -->
          <button class="btn btn-primary" onclick="importProduct()"><i class=" icon-share-alt icon-white"></i> 批量导入</button>
          <button class="btn btn-primary" onclick="foreverdel()"><i class="icon-trash icon-white"></i> 删除</button>
      </div>
          <form class="search-form pull-right" method='get' action="__URL__">
            {:modList('Category',$_REQUEST['cat_id'],'span2','cat_id')}
              <input type="text" class="search-query span4" name="keywords" <notempty name='_REQUEST.keywords'>
                    <php>echo 'value="'.urldecode($_REQUEST['keywords']).'"'</php><else/>
                    placeholder="搜索"
                </notempty>
                >
                <input type="submit" class="btn btn-primary" value="搜索">
          </form>
  </div>
<!-- 功能组区域结束 -->
<php>
    function getCateName($cat_id=0){
        return getModelName($cat_id,'Category');
    }
    function getUnitName($cat_id=0){
        return getModelName($cat_id,'Unit');
    }
</php>
<!-- 列表显示区域  -->
<div class="list" >
<div id="result" class="result none"></div>
<html:list id="checkList" style="table table-bordered table-striped" name="action" checkbox="true" action="true" datasource="list" show="id:编号|5%:edit,name:名称:edit,ename:英文,cas:cas,cat_id|getCateName:产品分类,unit_id|getUnitName:单位,formula:分子式,weight:分子量,nature:性质,minstock:最低库存,create_time|toDate:创建时间,update_time|toDate:修改时间,status|getStatus:状态" actionlist="status|showStatus=$action['id'],edit:详情:id" />
</div>
<!--  分页显示区域 -->
<div class="page">{$page}</div>
<!-- 列表显示区域结束 -->
</div>
<!-- 主体内容结束 -->
</div>
<!-- 主页面结束 --><include file="Public:footer"/>

<script type="text/javascript">
function copyproduct(id){
    var keyValue = (id)? id : getSelectCheckboxValues();
	if (keyValue=='')
	{
		alert('请选择拷贝项！');
		return false;
	}
    var copynum = prompt("请输入要复制的最终度数---(仅适用于隐形眼镜)","8");
    if(isNaN(copynum) || copynum<=0)
    {
        return false;
    }
	if (window.confirm('确实要复制吗？'))
	{
        //location.href = APP+"/Product/copyProduct/pid/"+keyValue+"/copynum/"+copynum;
	}
}

function massedit(id){
    var keyValue = (id)? id : getSelectCheckboxValues();
	if (keyValue=='')
	{
		alert('请选择编辑项！');
		return false;
	}
        location.href = APP+"/Product/massedit/pid/"+keyValue;
}

function importProduct(){
    location.href = APP+"/Product/import";
}

</script>
